package cn.lili.xiaoran.entity.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;

/**
 * 问卷
 *
 * @author LiLang
 * @since 2022/09/21
 */
@Data
@Accessors(chain = true)
public class LiQuestionnaireVo implements Serializable {

    @NotBlank
    private String enterpriseType;

    @NotBlank
    private String enterpriseDate;

    @NotBlank
    private String enterpriseScale;

    @NotBlank
    private String enterpriseStage;

    @NotBlank
    private List<QuestionGroup> data;

    private String name;

    @Data
    @Accessors(chain = true)
    public static class QuestionGroup {

        private String title;

        @JsonProperty("questiondata")
        private List<Question> questions;

    }

    @Data
    @Accessors(chain = true)
    public static class Question {

        private String title;

        private List<Answer> answers;

    }

    @Data
    @Accessors(chain = true)
    public static class Answer {

        @JsonProperty("answerscore")
        private Integer score;

        @JsonProperty("istrue")
        private Boolean istrue;

        @JsonProperty("answertitle")
        private String title;

        @JsonProperty("answerchecked")
        private Boolean checked;

    }

}